﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="LienEntrepriseContact.aspx.vb" Inherits="OpenDelib.LienEntrepriseContact" %>
<%@ Register TagPrefix="asp" Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" %>
<%@ Register TagPrefix="cc1" Namespace="Odyssee.WebControles" Assembly="Odyssee.WebControles" %>
<%@ Register Src="~/Tiers/CtrlAdresse.ascx" TagPrefix="uc1" TagName="CtrlAdresse" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body style="overflow-x:hidden;">
    <style type="text/css">
        .bloc {
            border:none;
            float:none;
            margin:0;
            min-width:initial;
            width:100%;
        }
    </style>
    
    <form id="form1" runat="server">
    
        <asp:ScriptManager ID="scriptManager" EnablePageMethods="true" runat="server" />


        <asp:UpdateProgress runat="server" id="upProgress">
            <ProgressTemplate>
                <div class="loader">
                    <div>
                        <img src="<%=ResolveUrl("~/images/loader_white.gif") %>" alt="" /><br />
                        <asp:Label ID="lblChargement" runat="server" Text="Veuillez patienter..."></asp:Label>
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel runat="server" id="upMain" style="width:100%; height:100%;">
            <ContentTemplate>

                <div id="divPrincipal" runat="server" class="bloc">

                    <%-------------------------%>
                    <%--  CHAMPS PRINCIPAUX  --%>
                    <%-------------------------%>

                    <div class="divTitle">
                        <asp:Label runat="server" Text="Lien" CssClass="labelDivTitle" />
                    </div>
    
                    <%--CONTACT--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Contact" CssClass="label" />
                    </div>
                    <asp:TextBox ID="txtContact" runat="server" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" Enabled="false" />

                    <%--ENTREPRISE--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Entreprise" CssClass="label" />
                    </div>
                    <asp:TextBox ID="txtEntreprise" runat="server" TextMode="SingleLine" CssClass="textbox upper" Style="width:calc(100% - 6px);" Enabled="false" />

                    <%--FONCTION--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Fonction" CssClass="label" />
                    </div>
                    <asp:DropDownList ID="cmbFonction" runat="server" CssClass="combo" Style="width: 100%; border: none;" />

                    <%--REMARQUES--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Remarques" CssClass="label" />
                    </div>
                    <asp:TextBox ID="txtRemarques" runat="server" TextMode="MultiLine" CssClass="textbox" Height="100px" Style="width:calc(100% - 6px);" />

                </div>
               
                <div id="tbAdresse" runat="server" class="bloc">

                    <%-------------------------%>
                    <%--     TAB ADRESSE     --%>
                    <%-------------------------%>

                    <div class="divTitle">
                        <asp:Label runat="server" Text="Adresse" CssClass="labelDivTitle" />
                    </div>

                    <%--ADRESSE--%>
                    <uc1:CtrlAdresse runat="server" ID="CtrlAdresse" />

                    <%--EMAIL--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Adresse mail" CssClass="label" />
                    </div>
                    <asp:TextBox ID="txtEMail" runat="server" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" MaxLength="60" onblur="checkTextBoxEmail()" />

                    <%--TYPE CHOIX ADRESSE--%>
                    <div class="divMiniTitle">
                        <asp:Label runat="server" Text="Choix de l'adresse" CssClass="label" />
                    </div>
                    <asp:DropDownList ID="cmbChoixAdresse" runat="server" CssClass="combo" Style="width: 100%; border: none; border-bottom: 2px solid black;" />

                </div>

                <%--<div id="tabs" runat="server" >
                    <ul>
                        <li><a href="<%= "#" & Me.tbGeneral.ClientID %>">Général</a></li>
                        <li><a href="<%= "#" & Me.tbAdresse.ClientID %>">Adresse</a></li>
                    </ul>

                    <div id="tbGeneral" runat="server">
                        <div class="divTitle">
                            <asp:Label runat="server" Text="Général" CssClass="labelDivTitle" />
                        </div>
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Service" CssClass="label" />
                        </div>
                        <asp:DropDownList ID="cmbService" runat="server" CssClass="combo" Style="width: 100%; border: none; border-bottom: 2px solid black;" />
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Type de lien" CssClass="label" />
                        </div>
                        <asp:DropDownList ID="cmbTypeLien" runat="server" CssClass="combo" Style="width: 100%; border: none; border-bottom: 2px solid black;" />
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Remarques" CssClass="label" />
                        </div>
                        <asp:TextBox ID="txtRemarques" runat="server" TextMode="MultiLine" CssClass="textbox" Height="100px" Style="width:calc(100% - 6px);" />
                    </div>
                    
                    <div id="tbAdresse" runat="server">
                        <div class="divTitle">
                            <asp:Label runat="server" Text="Adresse" CssClass="labelDivTitle" />
                        </div>
                        <uc1:CtrlAdresse runat="server" ID="CtrlAdresse" />
                       <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Adresse mail" CssClass="label" />
                        </div>
                        <asp:TextBox ID="txtEMail" runat="server" TextMode="SingleLine" CssClass="textbox" Style="width:calc(100% - 6px);" MaxLength="60" onblur="checkTextBoxEmail()" />
                        <div class="divMiniTitle">
                            <asp:Label runat="server" Text="Choix de l'adresse" CssClass="label" />
                        </div>
                        <asp:DropDownList ID="cmbChoixAdresse" runat="server" CssClass="combo" Style="width: 100%; border: none; border-bottom: 2px solid black;" />
                    </div>

                </div>
                <asp:HiddenField ID="hfIndexTabs" runat="server" Value="1" /> --%>


                <script>
                   <%-- $(document).ready(function () {
                        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () {
                            // par défaut, l'index tabs vaut 1 (Suivi)
                            var indexSaved = document.getElementById('<%=hfIndexTabs.ClientID%>').value
                            $("#<%=tabs.ClientID%>").tabs({
                                active:indexSaved,
                                activate: function(event, ui)
                                {
                                    document.getElementById('<%=hfIndexTabs.ClientID%>').value = ui.newTab.parent().children().index(ui.newTab);
                                }
                            });
                        });
                    });--%>

                    function validateEmail(email) {
                        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
                        return re.test(email);
                    }

                    function checkTextBoxEmail()
                    {
                        var txtbox = document.getElementById('<%=txtEMail.ClientID%>');
                        if (txtbox.value == '') return;
                        if (validateEmail(txtbox.value) == false)
                        {
                            alert('Adresse mail invalide');         
                        }
                    }
                </script>


                <div class="popupfixedbuttons" style="right:0px; text-align: center; width: 100%;">
                    <asp:Button ID="btnOK" CssClass="btn" Text="OK" runat="server" Width="100px" />
                    <input id="btnAnnuler" runat="server" type="button" value="Annuler" class="btn" style="width:100px;" />
                </div>

            </ContentTemplate>
        </asp:UpdatePanel>


    </form>
</body>
</html>
